﻿@using Sausage.Web.Models
@using Sausage.Web.DataModel
@using Sausage.Common
@using Telerik.Web.Mvc.UI
@model DictionaryItemListRow
@{
    ViewBag.Title = "常规数据字典管理";
    Layout = "~/Views/Shared/MainLayout.cshtml";

    //用于保存分类信息
    List<string> categoryModels = new List<string>();

    //查询字典分类信息
    using (SausageEntities context = new SausageEntities())
    {
        //查询所有角色信息
        foreach (Dictionay item in context.Dictionay.OrderBy(item => item.DictionayName))
        {
            //转换为字符串
            categoryModels.Add(string.Format("{{ ID: {0}, Name: '{1}', Memo:'{2}'}}", item.DictionayID, item.DictionayName, item.Memo));
        }
    }
}
@section HeadCssLink
{
    <link href="@Url.Content("~/Content/Styles/ext-patch.css")" rel="stylesheet" type="text/css" />
}
@section HeadScriptLink
{
    <script src="@Url.Content("~/Scripts/ExtJS/locale/ext-lang-zh_CN.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/common.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/model.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Sausage/Dictionary/Index.js")" type="text/javascript"></script>
    <script type="text/javascript">
        //用于保存分类信息
        var master_categories =
        [
            @Html.Raw(System.String.Join(",", categoryModels))
        ];

        //用于保存分类存储
        var store_master_categories = null;
    </script>
}
<h2>
    @ViewBag.Title
</h2>
<br />
<div id="data-grid" class="div-grid-box">
</div>
